<?php
class Megadrupal_Slider_Block_Adminhtml_Slide_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
{
		protected function _prepareForm()
		{

				$form = new Varien_Data_Form();
				$this->setForm($form);
				$fieldset = $form->addFieldset("slider_form", array("legend"=>Mage::helper("slider")->__("Item information")));

				
						$fieldset->addField("position", "text", array(
						"label" => Mage::helper("slider")->__("Position"),
						"name" => "position",
						));
					
						$fieldset->addField("settings", "textarea", array(
						"label" => Mage::helper("slider")->__("Setting"),
						"name" => "settings",
						));
					
						$fieldset->addField("layers", "textarea", array(
						"label" => Mage::helper("slider")->__("Layers"),
						"name" => "layers",
						));
					

				if (Mage::getSingleton("adminhtml/session")->getSlideData())
				{
					$form->setValues(Mage::getSingleton("adminhtml/session")->getSlideData());
					Mage::getSingleton("adminhtml/session")->setSlideData(null);
				} 
				elseif(Mage::registry("slide_data")) {
				    $form->setValues(Mage::registry("slide_data")->getData());
				}
				return parent::_prepareForm();
		}
}
